<?php

$pid = explode(',', $model->category->cate_id);
$pid = $pid[0];
$menu = array_reverse(Category::model()->generateBreadcrumbs($pid));

$this->breadcrumbs = array_merge($this->breadcrumbs,$menu);
$this->breadcrumbs = array_merge($this->breadcrumbs,array($model->pro_title));

$this->pageTitle = Category::model()->generatePageTitle(array_reverse($this->breadcrumbs,'_')).Yii::app()->name;

$this->menu=array(
	array('label'=>'List Project', 'url'=>array('index')),
	array('label'=>'Create Project', 'url'=>array('create')),
	array('label'=>'Update Project', 'url'=>array('update', 'id'=>$model->pro_id)),
	array('label'=>'Delete Project', 'url'=>'#', 'linkOptions'=>array('submit'=>array('delete','id'=>$model->pro_id),'confirm'=>'Are you sure you want to delete this item?')),
	array('label'=>'Manage Project', 'url'=>array('admin')),
);
?>

<?php


//	 $this->widget('ext.editor.syntaxhighlighter.syntaxhighlighterWidget',array(
//		'theme'=>'Django'
//));
?>

<?php $this->widget('ext.code.syntaxhighlighter.syntaxhighlighterWidget');?>
            <!-- Post -->
            <div class="post single clearfix">

				
					<hr />
					
					<h2><?php echo $model->pro_title; ?></h2>
					
				<ul class="post-meta">
                    <li class="author">By <a href="./blog_post.html"><?php echo $model->user->user_name;?></a></li>
                    <li class="date"><?php echo UtilTools::timeop($model->pro_created);?></li>
                    <li class="tags"><?php echo Tag::model()->tagsToLinks($model->pro_tags, 'labs/tags');?></li>
                    <li class="comments">有<?php echo $model->pro_hits;?>人浏览过此文</li>
                    <li class="comments">有<?php echo count($model->comment);?>条评论</li>
					<?php if(UtilAuth::isLogin($model->pro_uid)):?>
					<li class="modify"><?php echo UtilAuth::getAuthLinks('编辑', array('update','id'=>$model->pro_id));?></li>
					<?php endif;?>
                </ul>
                <div class="post-entry">
     				<div class="right">
                        <?php if(UtilAuth::isLogin($model->pro_uid)):?>
    					<button class="cupid-blue" onclick="location.href='<?php echo $this->createUrl('solution',array('id'=>$model->pro_id)) ?>'">创建新解决方案</button>
                        <?php endif;?>
    				</div>
 					<?php echo $model->pro_introduce;?>
      				<?php $this->widget('application.components.link.LabsPrevNextWidget',array(
    					'id'=>$model->pro_id
    				))?>                
                </div>

				
            </div>
            <!-- /Post -->
            
            
            <h5>相关内容</h5>
            <ul id="tabs">
                <li class="active"><a href="#tab1">已有解决方案</a></li>
                <li class=""><a href="#tab2">评论</a></li>
                <li class=""><a href="#tab3">我有话要说</a></li>
            </ul>
            <div id="tabs_content_container">
                <div style="display: block;" id="tab1" class="tab-content">
                    <?php $this->widget('zii.widgets.CListView', array(
						'dataProvider'=>$solution,
						'itemView'=>'_sview',
						'template'=>"{summary}\n{sorter}\n{items}\n{pager}"	
					)); ?>                        

                </div>
                <div style="display: none;" id="tab2" class="tab-content">
                     
                     <?php $this->widget('application.components.comment.CommentListWidget', array(
                            'controller'=>$this->id,
                            'action'=>$this->action->id,
                            'id'=>$model->pro_id 
                     ) ); ?>

                </div>
                <div style="display: none;" id="tab3" class="tab-content">
                    <?php $this->widget('application.components.comment.CommentFormWidget',array(
                            'id'=>$model->pro_id,
                            'controller'=>$this->id,
                            'action'=>$this->action->id
                    )); ?>
                </div>
            </div>
            

<?php 
//定义URL地址
$createUrl = $this->createUrl('/labs/solution');
?>